package model;

class MonitorConnexion extends Thread {
	boolean activ;
	int cptcour;
	int cptpre;
	MonitorConnexion(){
	    activ = true;
	}
	public void run(){
	    while (activ){
		cptpre = cptcour;
		cptcour = MainServer.canalUser.getCpt();
		MainServer.debitCanalUser = (cptcour-cptpre);
		//logger.log(Level.INFO,"connexion user " + debitCanalUser + "/s");
		try{
		    sleep(1000);
		}catch(InterruptedException e){}
	    }
	}
	void terminate(){
	    activ = false;
	}
    }
